package qf.wlh.com.oneprisdent;

import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;

public class SuggestionActivity extends AppCompatActivity {

    private EditText etEmail;
    private EditText etContetn;
    private ImageView ivBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_suggestion);
        etEmail = ((EditText) findViewById(R.id.activity_setting_suggestion_email));
        etContetn = ((EditText) findViewById(R.id.activity_setting_suggestion_content));
        ivBack = ((ImageView) findViewById(R.id.activity_setting_suggestion));
    }

    public void onClick(View view) {
        switch (view.getId()){
            case R.id.activity_setting_suggestion_submmit:
                String email = etEmail.getText().toString().trim();
                String content = etContetn.getText().toString().trim();
                if (TextUtils.isEmpty(email)||TextUtils.isEmpty(content)) {
                    Snackbar.make(view, "请输入正确的内容",Snackbar.LENGTH_SHORT).show();
                }
                else {
                    Snackbar.make(view, "已提交内容，谢谢您的参与",Snackbar.LENGTH_SHORT).show();
                }
                break;
            case R.id.activity_setting_suggestion:
                finish();
                break;
        }
    }
}
